package org.xin.security.service.impl;

import org.xin.security.pojo.entity.SysUserSecurity;
import org.xin.security.mapper.SysUserSecurityMapper;
import org.xin.security.service.ISysUserSecurityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import org.xin.framework.base.service.impl.IBaseServiceImpl;

/**
* <p>
    * 系统模块-用户安全表 服务实现类
    * </p>
*
* @author: xin
* @date: Create in 2021-09-29
*/
@Slf4j
@Service
public class SysUserSecurityServiceImpl extends IBaseServiceImpl<SysUserSecurity, SysUserSecurityMapper> implements ISysUserSecurityService {
    @Override
    public SysUserSecurity selectByUsername(String username) {
        lambdaQueryWrapper().eq(SysUserSecurity::getUsername, username);
        return getOne(lambdaQueryWrapper);
    }

    @Override
    public Boolean checkUserNameUnique(String username) {
        lambdaQueryWrapper().eq(SysUserSecurity::getUsername, username);
        return baseMapper.selectCount(lambdaQueryWrapper) != 0;
    }
}
